 <%--
 *  File:   DoctorRecipeNumber.jsp
 *  Desc:	the Lend slip summary page
 *
 *  Date		  Author		  Changes
 *  2011-1-25	  KevinFan		  Created
 *
 *  Copyright (C) 2000 - 2011 Oval Technologies, Inc.
 *  All rights reserved.
 *
 *  This software is the confidential and proprietary information of Oval
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>
<%
  //init param
  String privilegeCode = "A0104";
  String strTableName = "v_doctorchufangliangdoc";
  String strModuleName = "COM";
  String contextPath = request.getContextPath();
%>
<%@ include file="/inc/CommonHeader.inc" %>
<%@ include file="/inc/OvalLocationDefault.inc" %>
<%@ include file="/rpt/ReportURL.inc" %>
<html>
<head>
<title>DoctorRecipeNumber</title>
<PageFlow:CheckPageFlow pageName="p_doctorchufangliangdoc"/>
<%

HashMap userinfo = (HashMap)session.getAttribute("userinfo");
Integer  issalesman = (Integer) userinfo.get("issalesman");
String flag = (String)pageContext.getAttribute("flag");
String  isadmin=(String)userinfo.get("isadmin");

%>
<%@ include file="/inc/CatchError.inc" %>
<%@ include file="/inc/SumDiv.inc" %>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=contextPath%>/css/<%= strLanguageCode %>/main.css" type="text/css">
<script language="JavaScript" src="<%=contextPath%>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/ScriptLib.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/SummaryDivision.js"></script>
<script language="JavaScript">
function page_summary(actionvalue,orderbyname)
{
  var editform = summaryPrepare(cform,actionvalue,orderbyname);
  if(!editform) return;
  editform.action = "DoctorRecipeNumberDoc.jsp?<%= OvalTools.randomURL() %>";
  editform.target = "_self";
  isRunning = true;
  editform.submit();
}

function clickRow(obj,idx)
{
  var cform = document.cform;
  cform.radiorow[idx].checked=true;
 // cform.orgcode.value = eval('obj.all.orgcode'+idx).value;
 // cform.itemcode.value = eval('obj.all.itemcode'+idx).value;
 // cform.qty.value = eval('obj.all.qty'+idx).value;
 cform.orgid.value = eval('obj.all.orgid'+idx).value;
 cform.productid.value = eval('obj.all.productid'+idx).value;
}

//salesman
function popRep() {
    var status = "height=400, width=600, top=100, left=100, toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no";
	var url = "<%=contextPath%>/tdr/dataverify/SalesPopWindow.jsp?<%= OvalTools.randomURL() %>";
	popwindow = window.open(url, "newwindow", status);
  }

function SetSalesMan(id,code,name){
	cform.userids.value=id;
	cform.employeecode.value=code;
	cform.employeename.value=name;
}

//getbusinessarea
function page_getpriviceoffice(){
	var objdeptcode=eval("cform.regionid");
	if (objdeptcode==""){
	    return;
	}
	var  datahandler = new  DataHandler();
	datahandler.add_params("regionid" , objdeptcode.value , "Integer");
	datahandler.getResultFromVector("resultproviceoffice","proviceofficename","proviceofficecode","document.cform.proviceofficelist");
	datahandler.add_job("j_doctorchufangliangdoc");
	datahandler.runDataHandler();
  }



function page_getbusinessarea(){
	var regionid = document.cform.regionid.value;
	var objdeptcode=eval("cform.proviceofficelist");
	if (objdeptcode==""){
	    return;
	}
	var  datahandler = new  DataHandler();
	datahandler.add_params("regionid" , regionid, "Integer");
	datahandler.add_params("proviceofficelist" , objdeptcode.value , "String");
	datahandler.getResultFromVector("resultbusinessarea","businessareaname","businessareacode","document.cform.businessarealist");
	datahandler.add_job("j_doctorchufangliangdoc");
	datahandler.runDataHandler();
 }




function page_excel(){

	var id = document.cform.userid.value;	
	var year =document.cform.years.value;
	var month =document.cform.months.value;
	var searchname = document.cform.searchname.value;
	var searchvalue = document.cform.searchvalue.value;
	if(searchvalue=="" || searchvalue==null)searchvalue=-1;
	var categorycode = document.cform.categorycode.value;
	var hospitalgrade = document.cform.hospitalgrade.value;
	var hospitaltype = document.cform.hospitaltype.value;
	var hospitallevel = document.cform.hospitallevel.value;
	var url;
	<%if (new Integer(1).equals(issalesman)){%>
	 <%if("Y".equals(isadmin)){%>
	     url="<%= reportURL %>/servlet/ExcecuteReport/DoctorRecipelData.sox?__folder=/ovalreport&rownum=2&year="+year+"&month="+month+"&searchname=a."+searchname+"&searchvalue="+escape(encodeURI(searchvalue))+"&categorycode="+categorycode+"&hospitalgrade="+hospitalgrade+"&hospitaltype="+hospitaltype;
 	   //window.open("<%= reportURL %>/servlet/ExcecuteReport/DoctorRecipelData.sox?__folder=/ovalreport&rownum=2&year="+year+"&month="+month+"&searchname=a."+searchname+"&searchvalue="+escape(encodeURI(searchvalue))+"&categorycode="+categorycode+"&hospitalgrade="+hospitalgrade+"&hospitaltype="+hospitaltype);	
	  <%}else{%>
	     url="<%= reportURL %>/servlet/ExcecuteReport/DoctorRecipelData.sox?__folder=/ovalreport&rownum=2&employeeid="+ id+"&year="+year+"&month="+month+"&searchname=a."+searchname+"&searchvalue="+escape(encodeURI(searchvalue))+"&categorycode="+categorycode+"&hospitalgrade="+hospitalgrade+"&hospitaltype="+hospitaltype;
	    //window.open("<%= reportURL %>/servlet/ExcecuteReport/DoctorRecipelData.sox?__folder=/ovalreport&rownum=2&employeeid="+ id+"&year="+year+"&month="+month+"&searchname=a."+searchname+"&searchvalue="+escape(encodeURI(searchvalue))+"&categorycode="+categorycode+"&hospitalgrade="+hospitalgrade+"&hospitaltype="+hospitaltype);	
	  <%}%>
	<% }else{  %>
	var userids =document.cform.userids.value;	
	var areaids = document.cform.areaids.value;
	 <%if("Y".equals(isadmin)){%>
	 url="<%= reportURL %>/servlet/ExcecuteReport/DoctorRecipelData.sox?__folder=/ovalreport&rownum=2&year="+year+"&month="+month+"&searchname=a."+searchname+"&searchvalue="+escape(encodeURI(searchvalue))+"&categorycode="+categorycode+"&hospitalgrade="+hospitalgrade+"&hospitaltype="+hospitaltype+"&employeeids="+userids+"&areaids="+areaids;
 	// window.open("<%= reportURL %>/servlet/ExcecuteReport/DoctorRecipelData.sox?__folder=/ovalreport&rownum=2&year="+year+"&month="+month+"&searchname=a."+searchname+"&searchvalue="+escape(encodeURI(searchvalue))+"&categorycode="+categorycode+"&hospitalgrade="+hospitalgrade+"&hospitaltype="+hospitaltype+"&employeeids="+userids+"&areaids="+areaids);	
 	 <%}else{%>
 	  url="<%= reportURL %>/servlet/ExcecuteReport/DoctorRecipelData.sox?__folder=/ovalreport&rownum=2&employeeid="+ id+"&year="+year+"&month="+month+"&searchname=a."+searchname+"&searchvalue="+escape(encodeURI(searchvalue))+"&categorycode="+categorycode+"&hospitalgrade="+hospitalgrade+"&hospitaltype="+hospitaltype+"&employeeids="+userids+"&areaids="+areaids;
 	  //window.open("<%= reportURL %>/servlet/ExcecuteReport/DoctorRecipelData.sox?__folder=/ovalreport&rownum=2&employeeid="+ id+"&year="+year+"&month="+month+"&searchname=a."+searchname+"&searchvalue="+escape(encodeURI(searchvalue))+"&categorycode="+categorycode+"&hospitalgrade="+hospitalgrade+"&hospitaltype="+hospitaltype+"&employeeids="+userids+"&areaids="+areaids);	
 	 <%}%>
 	<% }%>
 	DataReport(url);
 	/* var objform = document.createElement("form");
	 document.body.appendChild(objform);
	 var indexQM = url.indexOf("?");
	 var actionurl = url.substring(0, indexQM);  
	 var query = url.substring(indexQM + 1); 
	 if(indexQM>=0){
	 var params= url.substring(indexQM+1).split("&");
	 for(var i=0; i < params.length; i++){
	  var keyValuePair =params[i].split("=");
	  var input = document.createElement("input");
	     input.type="hidden";
	     input.name  = keyValuePair[0];
	     input.value = keyValuePair[1];
	     objform.appendChild(input);
	   }
	 }
	 objform.action = url;
	 objform.target = "_blank";
	 objform.method = "POST";
	 objform.submit();
	 //删除该 form  
	 document.body.removeChild(objform); */
 }

function page_csv(){
	var id = document.cform.userid.value;	
	var year =document.cform.years.value;
	var month =document.cform.months.value;
	var searchname = document.cform.searchname.value;
	var searchvalue = document.cform.searchvalue.value;
	if(searchvalue=="" || searchvalue==null)searchvalue=-1;
	var categorycode = document.cform.categorycode.value;
	var hospitalgrade = document.cform.hospitalgrade.value;
	var hospitaltype = document.cform.hospitaltype.value;
	var hospitallevel = document.cform.hospitallevel.value;
	var url;
	<%if (new Integer(1).equals(issalesman)){%>
	<%if("Y".equals(isadmin)){%>
	 url="<%= reportURL %>/csv?__report=/ovalreport/DoctorPOSData.txt"&year="+year+"&month="+month+"&searchname=a."+searchname+"&searchvalue="+escape(encodeURI(searchvalue))+"&categorycode="+categorycode+"&hospitalgrade="+hospitalgrade+"&hospitaltype="+hospitaltype+"&hospitallevel="+hospitallevel;
 	// window.open("<%= reportURL %>/csv?__report=/ovalreport/DoctorPOSData.txt"&year="+year+"&month="+month+"&searchname=a."+searchname+"&searchvalue="+escape(encodeURI(searchvalue))+"&categorycode="+categorycode+"&hospitalgrade="+hospitalgrade+"&hospitaltype="+hospitaltype+"&hospitallevel="+hospitallevel);	
	 <%}else{%>
	 url="<%= reportURL %>/csv?__report=/ovalreport/DoctorPOSData.txt&employeeid="+ id+"&year="+year+"&month="+month+"&searchname=a."+searchname+"&searchvalue="+escape(encodeURI(searchvalue))+"&categorycode="+categorycode+"&hospitalgrade="+hospitalgrade+"&hospitaltype="+hospitaltype+"&hospitallevel="+hospitallevel;
	 //window.open("<%= reportURL %>/csv?__report=/ovalreport/DoctorPOSData.txt&employeeid="+ id+"&year="+year+"&month="+month+"&searchname=a."+searchname+"&searchvalue="+escape(encodeURI(searchvalue))+"&categorycode="+categorycode+"&hospitalgrade="+hospitalgrade+"&hospitaltype="+hospitaltype+"&hospitallevel="+hospitallevel);	
	 <%}%>
	<% }else{  %>
	var userids =document.cform.userids.value;	
	var areaids = document.cform.areaids.value;
	<%if("Y".equals(isadmin)){%>
	  url="<%= reportURL %>/csv?__report=/ovalreport/DoctorPOSData.txt&year="+year+"&month="+month+"&searchname=a."+searchname+"&searchvalue="+escape(encodeURI(searchvalue))+"&categorycode="+categorycode+"&hospitalgrade="+hospitalgrade+"&hospitaltype="+hospitaltype+"&hospitallevel="+hospitallevel+"&employeeids="+userids+"&areaids="+areaids;
	  //window.open("<%= reportURL %>/csv?__report=/ovalreport/DoctorPOSData.txt&year="+year+"&month="+month+"&searchname=a."+searchname+"&searchvalue="+escape(encodeURI(searchvalue))+"&categorycode="+categorycode+"&hospitalgrade="+hospitalgrade+"&hospitaltype="+hospitaltype+"&hospitallevel="+hospitallevel+"&employeeids="+userids+"&areaids="+areaids);	
	 <%}else{%>
	  url="<%= reportURL %>/csv?__report=/ovalreport/DoctorPOSData.txt&employeeid="+ id+"&year="+year+"&month="+month+"&searchname=a."+searchname+"&searchvalue="+escape(encodeURI(searchvalue))+"&categorycode="+categorycode+"&hospitalgrade="+hospitalgrade+"&hospitaltype="+hospitaltype+"&hospitallevel="+hospitallevel+"&employeeids="+userids+"&areaids="+areaids;
	  //window.open("<%= reportURL %>/csv?__report=/ovalreport/DoctorPOSData.txt&employeeid="+ id+"&year="+year+"&month="+month+"&searchname=a."+searchname+"&searchvalue="+escape(encodeURI(searchvalue))+"&categorycode="+categorycode+"&hospitalgrade="+hospitalgrade+"&hospitaltype="+hospitaltype+"&hospitallevel="+hospitallevel+"&employeeids="+userids+"&areaids="+areaids);	
	 <%}%>
 	<% }%>
 	DataReport(url);
 	/* var objform = document.createElement("form");
	 document.body.appendChild(objform);
	 var indexQM = url.indexOf("?");
	 var actionurl = url.substring(0, indexQM);  
	 var query = url.substring(indexQM + 1); 
	 if(indexQM>=0){
	 var params= url.substring(indexQM+1).split("&");
	 for(var i=0; i < params.length; i++){
	  var keyValuePair =params[i].split("=");
	  var input = document.createElement("input");
	     input.type="hidden";
	     input.name  = keyValuePair[0];
	     input.value = keyValuePair[1];
	     objform.appendChild(input);
	   }
	 }
	 objform.action = url;
	 objform.target = "_blank";
	 objform.method = "POST";
	 objform.submit();
	 //删除该 form  
	 document.body.removeChild(objform); */
 }

function page_clear(){
	//document.cform.regionid.value="";
	//document.cform.proviceofficelist.value="";
	//document.cform.businessarealist.value="";
	document.cform.employeename.value="";
	document.cform.categoryid.value=" ";
	document.cform.areaids.value ="";
	document.cform.businessareaname.value ="";
}
function changecategorycode(){
	
	var categoryIndex = cform.categoryid.options[cform.categoryid.selectedIndex].value;
	if(categoryIndex =="" || categoryIndex==null)cform.categorycode.value="";
	if(categoryIndex == 4 )cform.categorycode.value = "001";
	if(categoryIndex == 5 )cform.categorycode.value = "002";
	
}
function popBusinessarea_moulty(){
	if(popwindow!=null) popwindow.close();
	
    url = '<%=contextPath %>/phap/phap.datp/masterdata/cm/dataclean/ZylStdareaSelect.jsp?<%= OvalTools.randomURL() %>';
    attribute = 'height=600, width=900,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no';
	popwindow = window.open(url,'newwindow', attribute);
}
function setAreas(areaids,areanames,areacodes){

	document.cform.areaids.value = areaids;
	document.cform.businessareaname.value = areanames;
	//document.cform.businessareacode.value = areacodes;
} 
function onLoad(){
	<%
	String strcatid = "";
	if(pageContext.getAttribute("categoryid")=="" || pageContext.getAttribute("categoryid")==null){
		strcatid = "-1";
	}else{
		strcatid = (Integer)pageContext.getAttribute("categoryid")+"";
	}
	%>
	<%if(strcatid.equals("4")){%>
	cform.categoryid.options[1].selected=true;
	<%}else if(strcatid.equals("5")){%>
	cform.categoryid.options[2].selected=true;
	<%}else{%>
	cform.categoryid.options[0].selected=true;
	<%}%>
	}

</script>


<style type="text/css">
*{padding:0;margin:0;}
.container {width:230px;margin:1px auto;}
.holder2 {color:#FDFAC5;}
/*wu tu yuan jiao*/
.b1 {height:1px; font-size:1px; overflow:hidden; display:block; background:#FDFAC5; margin:0 5px;background-color:#FDFAC5}
.b2 {height:1px; font-size:1px; overflow:hidden; display:block; background:#FDFAC5; border-right:2px solid #FDFAC5; border-left:2px solid #FDFAC5; margin:0 3px;background-color:#FDFAC5}
.b3 {height:1px; font-size:1px; overflow:hidden; display:block; background:#FDFAC5; border-right:1px solid #FDFAC5; border-left:1px solid #FDFAC5; margin:0 2px;background-color:#FDFAC5}
.b4 {height:2px; font-size:1px; overflow:hidden; display:block; background:#FDFAC5; border-right:1px solid #FDFAC5; border-left:1px solid #FDFAC5; margin:0 1px;background-color:#FDFAC5}
.content {border-right:1px solid #FDFAC5; height:15px;border-left:1px solid #FDFAC5;background-color:#FDFAC5}
</style>

</head>
<body bgcolor="#FFFFFF" text="#000000" onload='onLoad();changecategorycode();'>
<iframe id="reloadHandler" name="reloadHandler" style="display:none"></iframe>
<form name="cform" method="post" action="<%=contextPath%>/Dispatcher">
  <input type="hidden" name="pagename" value=p_doctorchufangliangdoc>
  <input type="hidden" name="actionname">
  <input type="hidden" name="categorycode" />
  <input type="hidden" name="mark" value="1"/>
  <custom:hidden property="userid" name="userinfo" scope="session"></custom:hidden>
<%@ include file="/inc/PageLocation.inc" %>
<table width="100%" cellspacing="0" border="0" cellpadding="0">
  <tr>
    <td>
      <table width="100%" border="0" cellspacing="0">
        <tr>
          <td class="summary_top" width="10%" colspan="3"></td>
        </tr>
        <%@ include file="/inc/SummarySearch.inc" %>
      </table>
    </td>
  </tr>
  <tr>
    <td>
  <table width="95%" border="0" cellspacing="0" >
  <tr>
  <%
             java.util.Calendar cal = java.util.Calendar.getInstance();   
                  String year = cal.get(Calendar.YEAR)+"";     
					String month = cal.get(Calendar.MONTH)+"";
					if(cal.get(Calendar.MONTH) == 0){
						month = "12";
						year = (cal.get(Calendar.YEAR)-1)+"";
					}  
					if("first".equals(flag)){ 
				%>
				
	        	<td class="td_right" ><%=label.getLabelName("L_Year1") +  label.getLabelName("L_Colon") %></td>
	        	<td class="td_left"><custom:selectdic property="years" dictType="Years" command="notnull" value="<%=year %>" label="L_Year1"/></td>
	        	<td class="td_right"><%=label.getLabelName("L_Month") +  label.getLabelName("L_Colon") %></td>
	        	<td class="td_left"><custom:selectdic property="months" dictType="Months" command="notnull" value="<%=month %>" label="L_Month"/></td>
	        	<td class="td_right"><%=label.getLabelName("L_ProdCategory") +  label.getLabelName("L_Colon") %></td>
				<td class="td_left"><custom:selectdic property="categoryid" dictType="PatentOrPopular" value="4,5" defaultValueCost="" defaultValue="-----------" onchange="changecategorycode();"></custom:selectdic></td>
	        	<td>&nbsp;</td>
				<td width="*"> 
	        	<div class="container">
                   <div class="holder">
                     <b class="b1"></b><b class="b2"></b><b class="b3"></b><b class="b4"></b>
                       <div class="content">
                           <p>&nbsp;&nbsp;&nbsp;&nbsp;<font size="3"><b><%=label.getLabelName("L_TIP_SPAN") %></b></font>&nbsp;:&nbsp;&nbsp;<%=label.getLabelName("L_TIP_SPAN_VIEW") %></p>
                       </div>
                       <b class="b4"></b><b class="b3"></b><b class="b2"></b><b class="b1"></b>
                      </div>
                  </div>
	        	</td>
	        	<%}else{ %>
	        	<td class="td_right"><%=label.getLabelName("L_Year1") +  label.getLabelName("L_Colon") %></td>
	        	<td class="td_left"><custom:selectdic property="years" dictType="Years" command="notnull" label="L_Year1"/></td>
	        	<td class="td_right"><%=label.getLabelName("L_Month") +  label.getLabelName("L_Colon") %></td>
	        	<td class="td_left"><custom:selectdic property="months" dictType="Months" command="notnull" label="L_Month"/></td>
	        	<td class="td_right"><%=label.getLabelName("L_ProdCategory") +  label.getLabelName("L_Colon") %></td>
				<td class="td_left"><custom:selectdic property="categoryid" dictType="PatentOrPopular" value="4,5" defaultValueCost="" defaultValue="-----------" onchange="changecategorycode();"></custom:selectdic></td>
	        	<td>&nbsp;</td>
				<td width="*"> 
	        	<div class="container">
                   <div class="holder">
                     <b class="b1"></b><b class="b2"></b><b class="b3"></b><b class="b4"></b>
                       <div class="content">
                           <p>&nbsp;&nbsp;&nbsp;&nbsp;<font size="3"><b><%=label.getLabelName("L_TIP_SPAN") %></b></font>&nbsp;:&nbsp;&nbsp;<%=label.getLabelName("L_TIP_SPAN_VIEW") %></p>
                       </div>
                       <b class="b4"></b><b class="b3"></b><b class="b2"></b><b class="b1"></b>
                      </div>
                  </div>
	        	</td>
	        	    <%
	        	    }
			        %>
                    </tr>
					<tr>
						<td class="td_right"><%=label.getLabelName("L_Hospital") + label.getLabelName("L_FileType") + label.getLabelName("L_Colon") %></td>
						<td class="td_left"><custom:selectdic dictType="HospitalType" property="hospitaltype"  defaultValueCost="" defaultValue="-----------"/></td>
						<td class="td_right"><%= label.getLabelName("L_Hospital") +  label.getLabelName("L_Grade") + label.getLabelName("L_Colon") %></td>                
						<td class="td_left"><custom:selectdic dictType="YLHospitalLevel" property="hospitalgrade" defaultValue="-------------"  defaultValueCost="" /></td>
						<td class="td_right"><%= label.getLabelName("L_Country") + label.getLabelName("L_level") + label.getLabelName("L_Colon") %></td>
						<td class="td_left"><custom:selectdic dictType="HospitalLevel" property="hospitallevel" defaultValue="------------"  defaultValueCost=""/></td>
					</tr>
        	     <% 
               if (new Integer(1).equals(issalesman)){
	             %> 
	                <%}else{ %>
        	    <tr>
        	     <td   class="td_right"><%=label.getLabelName("L_Provicetdr") +  label.getLabelName("L_Colon") %></td>
			    <td  class="td_left"><custom:hidden  property="areaids" /><custom:text  property="businessareaname"  label="L_Provicetdr" readonly="true"/>
			    <a onclick="popBusinessarea_moulty()"><custom:button type="3" value="*"/></a>	
		        </td>
		        <td  class="td_right"><%=label.getLabelName("L_BusinessContact") +  label.getLabelName("L_Colon") %></td>
				<td  class="td_left">
			<custom:text property="employeename" size="20"  style="border:1px #7F9DB9 solid;"/>
			<a onClick="javascript:popRep();"><custom:button type="3" label="L_Asterisk" imgsrc="flash.gif" border="0"/></a> 
			<custom:hidden property="userids"/>
			<custom:hidden property="employeecode"/>
		   <button type="button" onclick="page_clear()" class="button1" name="re" value="clear" style="width:60"><%=label.getLabelName("L_Clear") %></button></td>
			<%} %>
        	</tr>
          </table>
    </td>
  </tr>
    <tr>
        <td>
          <table width="100%" border="1" cellpadding="0" bordercolorlight="#999999" bordercolordark="#FFFFFF" cellspacing="0" align="center">
  
  <%
    ArrayList titleTdArray = new ArrayList();
    titleTdArray.add(new TD("22","&nbsp;"));
//    titleTdArray.add(new TD("22","<input type=\"checkbox\" onclick=''"));
    titleTdArray.add(new TitleTD("90","L_HospitalCode") );
    titleTdArray.add(new TitleTD("170","L_HospitalName"));
    titleTdArray.add(new TitleTD("120","L_EmployeeName"));
    titleTdArray.add(new TitleTD("90","L_Product"));
    titleTdArray.add(new TitleTD("160","L_ProdName"));
    titleTdArray.add(new TitleTD("100","L_UpSalesNumber"));
    titleTdArray.add(new TitleTD("100","L_DoctorRecipel"));
    titleTdArray.add(new TitleTD("100","L_Unaccepted"));
 %>
    <custom:titletr styleClass="deepblue-left" tdArray="<%=titleTdArray%>" />
  
<%
     ArrayList detailTdArray = new ArrayList();
     detailTdArray.add(new RadioTD());
     detailTdArray.add(new WriteTD("orgcode"));
     detailTdArray.add(new WriteTD("orgname"));
     detailTdArray.add(new WriteTD("salesrepname"));
     detailTdArray.add(new WriteTD("itemcode"));
     detailTdArray.add(new WriteTD("itemname"));
     detailTdArray.add(new WriteTD("salesqty"));
     detailTdArray.add(new WriteTD("qty"));
     detailTdArray.add(new WriteTD("cyqty"));
     
     ArrayList hiddenArray = new ArrayList();
	 hiddenArray.add(new HiddenInput("orgcode",true));
     //hiddenArray.add(new HiddenInput("itemcode",true));
     //hiddenArray.add(new HiddenInput("qty",true));
	 hiddenArray.add(new HiddenInput("orgid",true));
     hiddenArray.add(new HiddenInput("productid",true));

     %>
      <custom:iteratetr tdArray="<%=detailTdArray%>" hiddenArray="<%=hiddenArray%>"  dataSource="totalsummary"/>
        <tr> 
	          <td colspan="6" style="text-align:right"><%=label.getLabelName("L_PageSum") +  label.getLabelName("L_Colon")%></td>
				<td class="red"><b><custom:write name="sumhash" property="sumsalesqty" nbsp="true"/></b></td>
				<td class="red"><b><custom:write name="sumhash" property="sumqty" nbsp="true"/></b></td>
				<td class="red"><b><custom:write name="sumhash" property="sumcyqty" nbsp="true"/></b></td>
				
	        </tr>
	        <tr> 
	          <td colspan="6" style="text-align:right"><%=label.getLabelName("L_TotalSum") +  label.getLabelName("L_Colon")%></td>
				
				<td class="red"><b><custom:write name="sumhash" property="doctorsumsalesqty" nbsp="true" dataType="number" dataFormatName="qtyviewformat" /></b></td>
				<td class="red"><b><custom:write name="sumhash" property="doctorsumqty"   dataType="number" dataFormatName="qtyviewformat" nbsp="true"/></b></td>
			<td class="red"><b><custom:write name="sumhash" property="doctorsumcyqty"   dataType="number" dataFormatName="qtyviewformat" nbsp="true"/></b></td>
	      
          <%@ include file="/inc/SummaryAction.inc" %>
        </tr>
      </table>
           <table width="100%" cellspacing="0" cellpadding="0">
            <tr><td class="summary_top"></td></tr>
            <tr>
              <td class="td_center">
                   <td class="td_center">
              	<% if(pageContext.getAttribute("totalsummary")!=null){%>
				<a onclick="page_Detail();"><custom:button type="1" label="L_CheckDetail" imgsrc="Modify.gif" border="0" style="width:100"/></a>&nbsp;&nbsp;
              	<%} %>
				<a onclick="page_excel();"><custom:button type="1" label="L_ExcelE" imgsrc="Modify.gif" border="0" style="width:100" privilegeCode="MB-CFL01"/></a>
				<a onclick="page_csv();"><custom:button type="1" label="L_ExportCSV" imgsrc="Modify.gif" border="0" style="width:100" privilegeCode="MB-CFL02"/></a>
              </td>
            </tr>
          </table>
    </td>
  </tr>
 </table>
<script>
function page_Detail()
{
	var year = cform.years.value;
	var month = document.cform.months.value;
	var productid = document.cform.productid.value;
	var orgid = document.cform.orgid.value;
	popup('DoctorSalesDetail.jsp?<%= OvalTools.randomURL() %>&orgid='+orgid+'&productid='+productid+'&year='+year+'&month='+month,'newwindow','height=500, width=1100,top=100,left=100,toolbar=n0, menubar=no, scrollbars=yes, resizable=no, location=no, status=no');
}
</script>
 </form>
</body>
</html>

